package util.AST.Expressao;

import util.AST.Terminal.OpAri;

public class ExpressaoAri extends Expressao {
	
	private ExpressaoAri expEsq;
	private OpAri operador;
	private ExpressaoAri expDir;
	
	public ExpressaoAri(ExpressaoAri expEsq, OpAri op, ExpressaoAri expDir){
		this.expEsq = expEsq;
		this.operador = op;
		this.expDir = expDir;
	}
	
	public ExpressaoAri(){
		
	}
	
	public ExpressaoAri getExpressaoEsq(){
		return this.expEsq;
	}
	
	public OpAri getOperador(){
		return this.operador;
	}
	
	public ExpressaoAri getExpressaoDir(){
		return this.expDir;
	}

	public String toString(int level) {
		int nextLevel = level+5;
		StringBuffer str = new StringBuffer();
		str.append("ExpAri\n");
		if ( this.expEsq != null ) {
			str.append(super.getSpaces(nextLevel) + "|-" + this.expEsq.toString(nextLevel));
		}
		if ( this.operador != null ) {
			str.append(super.getSpaces(nextLevel) + "|-" + this.operador.toString(nextLevel));
		}
		if ( this.expDir != null ) {
			str.append(super.getSpaces(nextLevel) + "|-" + this.expDir.toString(nextLevel));
		}
		return str.toString();
	}
	
}
